import Home from "@/views/Home";
import AppHeader from "@/components/AppHeader";
import Tabbar from "@/components/Tabbar";
import MallSort from "@/components/MallSort";

//异步组件实现路由懒加载
const Mall = () => import("@/views/Mall");
const Cart = () => import("@/views/Cart");
const Mine = () => import("@/views/Mine");
const AboutUs = () => import("@/views/AboutUs");
const OrderList = () => import("@/views/OrderList");
const Coupon = () => import("@/views/Coupon");
const SetUp = () => import("@/views/SetUp");
const Wallet = () => import("@/views/Wallet");
const GoodsList = () => import("@/views/GoodsList");
const Details = () => import("@/views/Details");
const OrderConfirm = () => import("@/views/OrderConfirm");
const Select = () => import("@/views/Select");
const Login = () => import("@/views/Login");

export default [
  //首页
  {
    path: "/",
    name: "Home",
    components: {
      default: Home,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      isNav: true,
      title: "首页",
      icon: "wap-home-o"
    }
  },
  //商城
  {
    path: "/mall",
    name: "Mall",
    components: {
      default: Mall,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      isNav: true,
      title: "商城",
      icon: "apps-o"
    },
    children: [
      {
        path: "mall-sort/:id",
        name: "MallSort",
        component: MallSort,
        meta: {
          title: "分类列表"
        }
      }
    ]
  },
  {
    path: "/goods_list/:url",
    name: "GoodsList",
    components: {
      default: GoodsList,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "商品列表"
    }
  },
  {
    path: "/details/:id",
    name: "Details",
    components: {
      default: Details,
      AppHeader: AppHeader
    },
    meta: {
      title: "商品详情"
    }
  },
  //购物车
  {
    path: "/cart",
    name: "cart",
    components: {
      default: Cart,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      isNav: true,
      title: "购物车",
      icon: "shopping-cart-o"
    }
  },
  //我的
  {
    path: "/mine",
    name: "Mine",
    components: {
      default: Mine,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      isNav: true,
      title: "我的",
      icon: "user-o",
      orderList: [
        {
          path: "/order-list",
          name: "OrderList",
          title: "待付款",
          icon: "peer-pay"
        },
        {
          path: "/order-list",
          name: "OrderList",
          title: "待收货",
          icon: "logistics"
        },
        {
          path: "/order-list",
          name: "OrderList",
          title: "已完成",
          icon: "completed"
        },
        {
          path: "/order-list",
          name: "OrderList",
          title: "全部订单",
          icon: "orders-o"
        }
      ],
      cellList: [
        {
          path: "/wallet",
          name: "Wallet",
          title: "钱包",
          icon: "balance-o"
        },
        {
          path: "/coupon",
          name: "Coupon",
          title: "优惠劵",
          icon: "coupon-o"
        },
        {
          path: "/set-up",
          name: "SetUp",
          title: "设置",
          icon: "setting-o"
        },
        {
          path: "/about-us",
          name: "AboutUs",
          title: "关于",
          icon: "info-o"
        }
      ]
    }
  },
  {
    path: "/coupon",
    name: "Coupon",
    components: {
      default: Coupon,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "优惠券"
    }
  },
  {
    path: "/wallet",
    name: "Wallet",
    components: {
      default: Wallet,
      AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "钱包余额"
    }
  },
  {
    path: "/set-up",
    name: "SetUp",
    components: {
      default: SetUp,
      AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "设置中心"
    }
  },
  {
    path: "/about-us",
    name: "AboutUs",
    components: {
      default: AboutUs,
      AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "关于我们"
    }
  },
  {
    path: "/order-confirm",
    name: "OrderConfirm",
    components: {
      default: OrderConfirm,
      AppHeader: AppHeader
    },
    meta: {
      title: "结算"
    }
  },
  {
    path: "/select",
    name: "Select",
    components: {
      default: Select,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "搜索"
    }
  },
  {
    path: "/login",
    name: "Login",
    components: {
      default: Login,
      AppHeader: AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "登录"
    }
  },
  {
    path: "/order-list",
    name: "OrderList",
    components: {
      default: OrderList,
      AppHeader,
      AppFooter: Tabbar
    },
    meta: {
      title: "订单列表",
      optionsList: [
        {
          id: 1,
          title: "全部订单"
        },
        {
          id: 2,
          title: "待付款"
        },
        {
          id: 3,
          title: "待收货"
        },
        {
          id: 4,
          title: "已完成"
        }
      ]
    }
  }
];
